home *** CD-ROM | disk | FTP | other *** search
/ CD School House 9 / CD School House 9.0 - Wayzata Technology (1994).iso / pc / games / mac / __adventureland__ / __adventure_helpers__ / gurps__3rd_edition / stack.txt < prev   
Text File  |  1991-01-08  |  14KB  |  425 lines

  1. -- stack: in
  2. -- format: 8 (HyperCard 1)
  3. -- flags: 0x1000 (none)
  4. -- protect password hash: 0
  5. -- maximum user level: 5 (scripting)
  6. -- window: Rect(x1=0, y1=0, x2=0, y2=0)
  7. -- screen: Rect(x1=0, y1=0, x2=0, y2=0)
  8. -- card dimensions: w=0 h=0
  9. -- scroll: x=0 y=0
  10. -- background count: 2
  11. -- first background id: 2662
  12. -- card count: 139
  13. -- first card id: 11043
  14. -- list block id: 59740
  15. -- print block id: 12290
  16. -- font table block id: 0
  17. -- style table block id: 0
  18. -- free block count: 1
  19. -- free size: 1600 bytes
  20. -- total size: 385024 bytes
  21. -- stack block size: 12288 bytes
  22. -- created by hypercard version: 0x00000000
  23. -- compacted by hypercard version: 0x01258000
  24. -- modified by hypercard version: 0x01228000
  25. -- opened by hypercard version: 0x01228000
  26. -- patterns[0]: 0x0000000000000000
  27. -- patterns[1]: 0x8000000008000000
  28. -- patterns[2]: 0x8800220088002200
  29. -- patterns[3]: 0x8888222288882222
  30. -- patterns[4]: 0x88AA22AA88AA22AA
  31. -- patterns[5]: 0xCCAA33AACCAA33AA
  32. -- patterns[6]: 0xEEAABBAAEEAABBAA
  33. -- patterns[7]: 0xEEBBBBEEEEBBBBEE
  34. -- patterns[8]: 0xFFBBFFEEFFBBFFEE
  35. -- patterns[9]: 0xFFBBFFFFFFBBFFFF
  36. -- patterns[10]: 0x8010022001084004
  37. -- patterns[11]: 0xFFFFFFFFFFFFFFFF
  38. -- patterns[12]: 0x8822882288228822
  39. -- patterns[13]: 0x1122448811224488
  40. -- patterns[14]: 0xC4800C6843023026
  41. -- patterns[15]: 0xB130031BD8C00C8D
  42. -- patterns[16]: 0xAA00AA00AA00AA00
  43. -- patterns[17]: 0x8822552288225522
  44. -- patterns[18]: 0x8855225588552255
  45. -- patterns[19]: 0x77DD77DD77DD77DD
  46. -- patterns[20]: 0x8000000000000000
  47. -- patterns[21]: 0xAA55AA55AA55AA55
  48. -- patterns[22]: 0x038448300C020101
  49. -- patterns[23]: 0x8244394482010101
  50. -- patterns[24]: 0x8814224188412214
  51. -- patterns[25]: 0x8080413E080814E3
  52. -- patterns[26]: 0x22048C7422179810
  53. -- patterns[27]: 0xBE808808EB088880
  54. -- patterns[28]: 0x25C8328964244C92
  55. -- patterns[29]: 0xA29C41BE2AC914EB
  56. -- patterns[30]: 0x40A00000040A0000
  57. -- patterns[31]: 0x8040200002040800
  58. -- patterns[32]: 0xAA00800088008000
  59. -- patterns[33]: 0xFF80808080808080
  60. -- patterns[34]: 0x081C22C180010204
  61. -- patterns[35]: 0xFF808080FF080808
  62. -- patterns[36]: 0xF87422478F172271
  63. -- patterns[37]: 0xBF00BFBFB0B0B0B0
  64. -- patterns[38]: 0xFF7FBE5DA2418000
  65. -- patterns[39]: 0xFAF5FAF5A050A050
  66. -- checksum: 0x0
  67. ----- HyperTalk script -----
  68.  
  69. On DoWeight
  70.   put field "Weight" of card "Work" into weight
  71.   if (weight > (line 5 of (field "Encumbrances" of card "Work")) ) then
  72.     put 0 into field "Move" of card "Work"
  73.   else
  74.     if (weight > (line 4 of (field "Encumbrances" of card "Work")) ) then
  75.       put DoMove(4) into field "Move" of card "Work"
  76.     else
  77.       if (weight > (line 3 of (field "Encumbrances" of card "Work")) ) then
  78.         put DoMove(3) into field "Move" of card "Work"
  79.       else
  80.         if (weight > (line 2 of (field "Encumbrances" of card "Work")) ) then
  81.           put DoMove(2) into field "Move" of card "Work"
  82.         else
  83.           if (weight > (line 1 of (field "Encumbrances" of card "Work")) ) then
  84.             put DoMove(1) into field "Move" of card "Work"
  85.           end if
  86.         end if
  87.       end if
  88.     end if
  89.   end if
  90.   Put (field "Move" of card "Work") into field "Dodge" of card "Work"
  91. End DoWeight
  92.  
  93. function DoMove E
  94. if (trunc(field "Speed" of card "Work"))>E then
  95.   put (trunc((field "Speed" of card "Work")-E)) into X
  96. else
  97.   put 1 into X
  98. end if
  99. return X
  100. End DoMove
  101.  
  102.  
  103.  
  104. function PointValue AT
  105. if AT=empty then
  106.   put 0 into P
  107. end if
  108. if AT=1 then
  109.   put value(-80) into P
  110. else if AT=2 then
  111.   put value(-70) into P
  112. else if AT=3 then
  113.   put value(-60) into P
  114. else if AT=4 then
  115.   put value(-50) into P
  116. else if AT=5 then
  117.   put value(-40) into P
  118. else if AT=6 then
  119.   put value(-30) into P
  120. else if AT=7 then
  121.   put value(-20) into P
  122. else if AT=8 then
  123.   put value(-15) into P
  124. else if AT=9 then
  125.   put value(-10) into P
  126. else if AT=10 then
  127.   put value(0) into P
  128. else if AT=11 then
  129.   put 10 into P
  130. else if AT=12 then
  131.   put 20 into P
  132. else if AT=13 then
  133.   put 30 into P
  134. else if AT=14 then
  135.   put 45 into P
  136. else if AT=15 then
  137.   put 60 into P
  138. else if AT=16 then
  139.   put 80 into P
  140. else if AT=17 then
  141.   put 100 into P
  142. else if AT=18 then
  143.   put 125 into P
  144. else if AT=19 then
  145.   put 150 into P
  146. else if AT=20 then
  147.   put 175 into P
  148. end if
  149. return P
  150. end PointValue
  151.  
  152. on ExD
  153.   global points
  154.   put 0 into ender
  155.   set the cursor to 4
  156.   put 1 into i
  157.   put line i of field "Disadvantages" of card "Work" into b
  158.   repeat while (b<>empty)
  159.     if offset(the param of 2,b)=1 then
  160.       put 1 into ender
  161.       put line i of field "Dpoints" of card "Work" into d
  162.       answer "Keep" && b & ", Cost: "& d & "?" with "Yes" or "No"
  163.       set the cursor to 4
  164.       if it is "No" then
  165.         put d into negpoints
  166.         put empty into line i of field "Disadvantages" of card "Work"
  167.         put empty into line i of field "Dpoints" of card "Work"
  168.         put points-negpoints into points
  169.         put points into field "Points" of card "Work"
  170.         put line i+1 of field "Disadvantages" of card "Work" into c
  171.         repeat while (c<>empty)
  172.           put line i+1 of field "Disadvantages" of card "Work" into line i of field "Disadvantages" of card "Work"
  173.           put line i+1 of field "DPoints" of card "Work" into line i of field "DPoints" of card "Work"
  174.           put empty into line i+1 of field "Disadvantages" of card "Work"
  175.           put empty into line i+1 of field "DPoints" of card "Work"
  176.           put i+1 into i
  177.           put line i+1 of field "Disadvantages" of card "Work" into c
  178.         end repeat
  179.       end if
  180.     end if
  181.     put i+1 into i
  182.     put line i of field "Disadvantages" of card "Work" into b
  183.   end repeat
  184.   if (ender=0) then
  185.     put the param of 1 into line i of Field "Disadvantages" of card "Work"
  186.     put the param of 3 into line i of field "DPoints" of card "Work"
  187.     put points+(the param of 3) into points
  188.     put points into field "Points" of card "Work"
  189.   end if
  190.   visual effect iris close
  191.   pop card
  192. end ExD
  193.  
  194. on AExD
  195.   global points
  196.   put 0 into ender
  197.   set the cursor to 4
  198.   put 1 into i
  199.   put line i of field "Advantages" of card "Work" into b
  200.   repeat while (b<>empty)
  201.     if offset(the param of 2,b)=1 then
  202.       put 1 into ender
  203.       put line i of field "Apoints" of card "Work" into d
  204.       answer "Keep" && b & ", Cost: "& d & "?" with "Yes" or "No"
  205.       set the cursor to 4
  206.       if it is "No" then
  207.         if ((the param of 2)="Eidetic Memory") then put 1 into field "Eidetic" of card "Work"
  208.         put d into negpoints
  209.         put empty into line i of field "Advantages" of card "Work"
  210.         put empty into line i of field "Apoints" of card "Work"
  211.         put points-negpoints into points
  212.         put points into field "Points" of card "Work"
  213.         put line i+1 of field "Advantages" of card "Work" into c
  214.         repeat while (c<>empty)
  215.           put line i+1 of field "Advantages" of card "Work" into line i of field "Advantages" of card "Work"
  216.           put line i+1 of field "APoints" of card "Work" into line i of field "APoints" of card "Work"
  217.           put empty into line i+1 of field "Advantages" of card "Work"
  218.           put empty into line i+1 of field "APoints" of card "Work"
  219.           put i+1 into i
  220.           put line i+1 of field "Advantages" of card "Work" into c
  221.         end repeat
  222.       end if
  223.     end if
  224.     put i+1 into i
  225.     put line i of field "Advantages" of card "Work" into b
  226.   end repeat
  227.   if (ender=0) then
  228.     put the param of 1 into line i of Field "Advantages" of card "Work"
  229.     put the param of 3 into line i of field "APoints" of card "Work"
  230.     put points+(the param of 3) into points
  231.     put points into field "Points" of card "Work"
  232.     if ((the param of 2)="Eidetic Memory") then
  233.       if ((the param of 1)="Eidetic Memory, Partial") then
  234.         put .5 into field "Eidetic" of card "Work"
  235.       else
  236.         put .25 into field "Eidetic" of card "Work"
  237.       end if
  238.     end if
  239.   end if
  240.   visual effect iris close
  241.   pop card
  242. end AExD
  243.  
  244. function NextSpace b
  245. put 1 into i
  246. put line i of field "Disadvantages" of card "Work" into b
  247. repeat until (b is empty)
  248.   put i+1 into i
  249.   put line i of field "Disadvantages" of card "Work" into b
  250. end repeat
  251. return i
  252. end NextSpace
  253.  
  254. function Exclusive AT
  255. global disadv,disadvp,points,killed
  256. set the cursor to 4
  257. put 1 into i
  258. put line i of field "Disadvantages" of card "Work" into b
  259. repeat while (b<>empty)
  260.   if offset(AT,b)=1 then
  261.     answer "Keep" && b & "?" with "Yes" or "No"
  262.     set the cursor to 4
  263.     if it is "No" then
  264.       put line i of field "DPoints" of card "Work" into negpoints
  265.       put empty into line i of field "Disadvantages" of card "Work"
  266.       put empty into line i of field "Dpoints" of card "Work"
  267.       put points-negpoints into points
  268.       put points into field "Points" of card "Work"
  269.       put line i+1 of field "Disadvantages" of card "Work" into c
  270.       repeat while (c<>empty)
  271.         put line i+1 of field "Disadvantages" of card "Work" into line i of field "Disadvantages" of card "Work"
  272.         put line i+1 of field "DPoints" of card "Work" into line i of field "DPoints" of card "Work"
  273.         put empty into line i+1 of field "Disadvantages" of card "Work"
  274.         put empty into line i+1 of field "Dpoints" of card "Work"
  275.         put i+1 into i
  276.         put line i+1 of field "Disadvantages" of card "Work" into c
  277.       end repeat
  278.       visual effect iris close
  279.       pop card
  280.       put empty into AT
  281.       return AT
  282.     else if it is "Yes" then
  283.       visual effect iris close
  284.       pop card
  285.       put empty into AT
  286.       return AT
  287.     end if
  288.   end if
  289.   put i+1 into i
  290.   put line i of field "Disadvantages" of card "Work" into b
  291. end repeat
  292. return AT
  293. end Exclusive
  294.  
  295. function Nonexclusive AT
  296. global disadv,disadvp,points,killed
  297. set the cursor to 4
  298. put 1 into i
  299. put line i of field "Disadvantages" of card "Work" into b
  300. repeat while (b<>empty)
  301.   if offset(AT,b)<>0 then
  302.     put line i of field "DPoints" of card "Work" into d
  303.     answer "Keep" && b & ", Cost:" && d & "?" with "Yes" or "No"
  304.     set the cursor to 4
  305.     if it is "No" then
  306.       put line i of field "DPoints" of card "Work" into negpoints
  307.       put empty into line i of field "Disadvantages" of card "Work"
  308.       put empty into line i of field "DPoints" of card "Work"
  309.       put points-negpoints into points
  310.       put points into field "Points" of card "Work"
  311.       put line i+1 of field "Disadvantages" of card "Work" into c
  312.       repeat while (c<>empty)
  313.         put line i+1 of field "Disadvantages" of card "Work" into line i of field "Disadvantages" of card "Work"
  314.         put line i+1 of field "DPoints" of card "Work" into line i of field "DPoints" of card "Work"
  315.         put empty into line i+1 of field "Disadvantages" of card "Work"
  316.         put empty into line i+1 of field "DPoints" of card "Work"
  317.         put i+1 into i
  318.         put line i+1 of field "Disadvantages" of card "Work" into c
  319.       end repeat
  320.       visual effect iris close
  321.       pop card
  322.       put empty into AT
  323.       return AT
  324.     end if
  325.   end if
  326.   put i+1 into i
  327.   put line i of field "Disadvantages" of card "Work" into b
  328. end repeat
  329. return AT
  330. end Nonexclusive
  331.  
  332. function AExclusive AT
  333. global disadv,disadvp,points,killed,langtalent
  334. set the cursor to 4
  335. put 1 into i
  336. put line i of field "Advantages" of card "Work" into b
  337. repeat while (b<>empty)
  338.   if offset(AT,b)=1 then
  339.     put line i of field "APoints" of card "Work" into d
  340.     answer "Keep" && b &", "&&"Cost:"&& d & "?" with "Yes" or "No"
  341.     set the cursor to 4
  342.     if it is "No" then
  343.       if AT="Language Talent" then put 0 into field "langtalent" of card "Work"
  344.       put d into negpoints
  345.       put empty into line i of field "Advantages" of card "Work"
  346.       put empty into line i of field "APoints" of card "Work"
  347.       put points-negpoints into points
  348.       put points into field "Points" of card "Work"
  349.       put line i+1 of field "Advantages" of card "Work" into c
  350.       repeat while (c<>empty)
  351.         put line i+1 of field "Advantages" of card "Work" into line i of field "Advantages" of card "Work"
  352.         put line i+1 of field "APoints" of card "Work" into line i of field "APoints" of card "Work"
  353.         put empty into line i+1 of field "Advantages" of card "Work"
  354.         put empty into line i+1 of field "APoints" of card "Work"
  355.         put i+1 into i
  356.         put line i+1 of field "Advantages" of card "Work" into c
  357.       end repeat
  358.       visual effect iris close
  359.       pop card
  360.       put empty into AT
  361.       return AT
  362.     else if it is "Yes" then
  363.       visual effect iris close
  364.       pop card
  365.       put empty into AT
  366.       return AT
  367.     end if
  368.   end if
  369.   put i+1 into i
  370.   put line i of field "Advantages" of card "Work" into b
  371. end repeat
  372. return AT
  373. end AExclusive
  374.  
  375. function ANonexclusive AT
  376. global disadv,disadvp,points,killed
  377. set the cursor to 4
  378. put 1 into i
  379. put line i of field "Advantages" of card "Work" into b
  380. repeat while (b<>empty)
  381.   if offset(AT,b)<>0 then
  382.     put line i of field "APoints" of card "Work" into d
  383.     answer "Keep" && b & ", Cost:" && d & "?" with "Yes" or "No"
  384.     set the cursor to 4
  385.     if it is "No" then
  386.       put line i of field "APoints" of card "Work" into negpoints
  387.       put empty into line i of field "Advantages" of card "Work"
  388.       put empty into line i of field "APoints" of card "Work"
  389.       put points-negpoints into points
  390.       put points into field "Points" of card "Work"
  391.       put line i+1 of field "Advantages" of card "Work" into c
  392.       repeat while (c<>empty)
  393.         put line i+1 of field "Advantages" of card "Work" into line i of field "Advantages" of card "Work"
  394.         put line i+1 of field "APoints" of card "Work" into line i of field "APoints" of card "Work"
  395.         put empty into line i+1 of field "Advantages" of card "Work"
  396.         put empty into line i+1 of field "APoints" of card "Work"
  397.         put i+1 into i
  398.         put line i+1 of field "Advantages" of card "Work" into c
  399.       end repeat
  400.       visual effect iris close
  401.       pop card
  402.       put empty into AT
  403.       return AT
  404.     end if
  405.   end if
  406.   put i+1 into i
  407.   put line i of field "Advantages" of card "Work" into b
  408. end repeat
  409. return AT
  410. end ANonexclusive
  411.  
  412. function ANextSpace b
  413. put 1 into i
  414. put line i of field "Advantages" of card "Work" into b
  415. repeat until (b is empty)
  416.   put i+1 into i
  417.   put line i of field "Advantages" of card "Work" into b
  418. end repeat
  419. return i
  420. end ANextSpace
  421.  
  422.  
  423.  
  424.  
  425.